package erfgame.core.entity;

import erfgame.core.world.World;
import erfgame.core.world.WorldAwarePrototype;

public class PrototypingEntityByTypeFactory implements EntityByTypeFactory {

	private WorldAwarePrototype<Entity> prototype;
	
	public PrototypingEntityByTypeFactory( WorldAwarePrototype<Entity> prototype ) {
		this.prototype = prototype;
	}
	
	public Entity createEntity(World world, EntityType type) {
		return prototype.spawn( world );
	}

}
